package itheima.com.threadatom4;

import java.util.concurrent.atomic.AtomicInteger;

public class MyAtomThread implements Runnable {
    AtomicInteger atom = new AtomicInteger(0);

    @Override
    public void run() {
        for (int i = 0; i < 100; i++) {
            int count = atom.incrementAndGet();
            System.out.println("已经送了"+count+"个冰淇淋哦");
        }
    }
}
